<?php
require 'core/conn.php';
//require 'core/function.php';
// require 'core/sqlsearch.php';
//echo conn();
//mysqli_query($conn,"INSERT INTO bbs0_users(user_username,user_password,user_createtime,user_rank)VALUE('admin','admin',0,10)");;

//session_unset();
//session_destroy();
echo md5("adminsadfasdfa")."<br />";
$scor = "1,3,5,7,456,56,";
$eee = explode(',',$scor);
var_dump($eee);
echo count($eee)-1;
foreach ($eee AS $valll){
    if (7 == $valll){
        echo "含有7";
    }else{
        echo "没有7";
    }
}

$asd = null;
$asd .= "1";
$asd .= "20";
echo $asd;
echo '<br />';
if (is_int("123456")){
    echo 'aaaaaaaaaaaaa';
}else{
    echo 'bbbbbbbbbbbbbbb';
}

$array = array("wfwaf", "qwerwea", "qwerqwerwreqwerqw");
echo $array[0];

//@$_mysqli = new mysqli('localhost', 'root', '', 'bbs_0');
////1 设置编码
//$_mysqli->set_charset('utf8');
////2 创建sql
//$_sql = 'SELECT * FROM bbs0_user';
////3 执行sql，把结果集赋给变量
//$_result = $_mysqli->query($_sql);
////取得第一行数据，运行一次，指针下移一条
//$_user = $_result->fetch_row();
//////4 获取
////4-1 使用索引数组循环出用户名
//while (!!$_row = $_result->fetch_row()) {
//    echo $_row[3] . '<br />';
//}
////4-2 使用关联数组循环出用户名
//while (!!$_assoc = $_result->fetch_assoc()) {
//    echo $_assoc['user_username'] . '<br />';
//}
////4-3 使用索引加关联数组
//print_r($_result->fetch_array());
////4-4 使用oop方式，但返回的是对象
//while (!!$_object = $_result->fetch_object()) {
//    echo $_object->tg_username . '<br />';
//}

//$one = 1;
////$two = 2;
////$array = array($one,$two);
////
////echo $array[0];
////
////$text = '我周围都是人';
////$search = '周围';
////
////function outred($text, $search){
////
////    $newtext = '';
////    return $newtext;
////}
////
////outred($text, $search);
////
////echo $userdate_a = str_replace("-","","199-5-51");
////
////echo '<br/>';
////
////$a = "20180509181503";
////
////echo date("y,m,d,h,m,s",$a);
////
////
////function testsql(){
////    global $conn;
////    $val = array(1,5,"wer","qwerqwerq");
////    mysqli_query($conn, "INSERT INTO bbs0_medals (medal_url)VALUES($val)");
////}
////
////testsql();
///
$s = 'abcd中文又如何efg';
$pattern = '/[\x7f-\xff]{3}/i'; //utf-8格式下中文长度为3
preg_match_all($pattern, $s, $matches); //匹配所有中文
$s = preg_replace($pattern, '123', $s); //删除所有中文
echo var_dump($matches) . var_dump($pattern);
echo '<br/>' . $s;
$te1 = "/字体/";
$te2 = "<span style=\"color:#ff0000\">字体</span>";
$echo_1 = "123字体123";
$echo_1 = preg_replace($te1, $te2, $echo_1);
echo $echo_1;
?>

123<font color="#ff0000">字体</font>123
123<span style="color:#ff0000">颜色</span>123


<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
    <title>javascript select options text value</title>
    <meta name="keywords" content="javascript select options text value add modify delete set">
    <meta name="description" content="javascript select options text value add modify delete set">
    <script language="javascript">
        <!--
        // Author: i@lxl.cn
        // Modify: i@cnlei.com
        function watch_ini() { // 初始
            for (var i = 0; i < arguments.length; i++) {
                var oOption = new Option(arguments[i], arguments[i]);
                document.getElementById("MySelect")[i] = oOption;
            }
        }

        function watch_add(f) { // 增加
            var oOption = new Option(f.word.value, f.word.value);
            f.keywords[f.keywords.length] = oOption;
        }

        function watch_sel(f) { // 编辑
            f.word.value = f.keywords[f.keywords.selectedIndex].text;
        }

        function watch_mod(f) { // 修改
            f.keywords[f.keywords.selectedIndex].text = f.word.value;
        }

        function watch_del(f) { // 删除
            f.keywords.remove(f.keywords.selectedIndex);
        }

        function watch_set(f) { // 保存
            var set = "";
            for (var i = 0; i < f.keywords.length; i++) {
                set += f.keywords[i].text + ";";
            }
            confirm(set);
        }

        //-->
    </script>
</head>
<body>
<form name="watch" method="post" action="">
    <select id="MySelect" name="keywords" size="10" onchange="watch_sel(this.form)"></select><br>
    <script language="javascript">
        <!--
        watch_ini("我", "你", "妳", "他", "她", "它", "尔"); // 初始关键词
        //-->
    </script>
    <input type="text" name="word"/><br/>
    <input type="button" value="增加" onclick="watch_add(this.form);"/>
    <input type="button" value="修改" onclick="watch_mod(this.form);"/>
    <input type="button" value="删除" onclick="watch_del(this.form);"/>
    <input type="button" value="保存" onclick="watch_set(this.form);"/>
</form>
</body>
</html>


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body style=" background: rgb(238, 255, 255);">
<input  type="color" id="onchange">

</body>
<script type="text/javascript">
    document.getElementById('onchange').onchange = function(){
        document.getElementById('onchange').click();
        document.body.style.background = this.value;
    };
</script>
</html>


